package com.propose.dao;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Component;

import com.propose.domain.ProposeCommand;

@Component
public class ProposeDaoImpl extends SqlSessionDaoSupport implements ProposeDao{

	@Override
	public void writePropose(ProposeCommand proposeCommand) {
		getSqlSession().insert("writePropose",proposeCommand);
	}
	
	@Override
	public int getRegistered(String id) {
		return getSqlSession().selectOne("checkRegistered",id);
	}
	
	@Override
	public void modifyMember(ProposeCommand proposeCommand) {
		getSqlSession().update("modifyMember2", proposeCommand);
	}

	@Override
	public int getRowCount(Map<String, Object> map) {
		return getSqlSession().selectOne("proposeListSelectCount",map);
	}
	
	@Override
	public List<ProposeCommand> proposeList(Map<String, Object> map) {
		List<ProposeCommand> list = getSqlSession().selectList("idleList",map);
		return list;
	}

	@Override
	public ProposeCommand selectPropose(String id) {
		return getSqlSession().selectOne("selectDetail",id);
	}

	@Override
	public void modifyPropose(ProposeCommand proposeCommand) {
		getSqlSession().update("modifyPropose",proposeCommand);
	}

	@Override
	public void deletePropose(String id) {
		getSqlSession().delete("deletePropose",id);
	}
	
	@Override
	public String getPassword(String id) {
		return getSqlSession().selectOne("getPassword",id);
	}

	@Override
	public String getSex(String id) {
		return getSqlSession().selectOne("getSex",id);
	}

	/*@Override
	public List<MemberCommand> getMember(String id) {
		return getSqlSession().selectOne("getMember",id);
	}*/

	/*@Override
	public List<ProposeCommand> searchIdle(ProposeSearchCommand search) {
		return getSqlSession().selectList("searchIdle",search);
	}*/
}